<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view />
    </div>
  </a-config-provider>
</template>

<script>
import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";
import {
  getToken
} from '@/utils/auth'
export default {
  name: 'App',
  data() {
    return {
      locale: zhCN,
      timerId: null
    }
  },
  mounted() {
    if (this.timerId == null) {
      this.updateLoginUserStatus()
      // console.log('注册定时器')
      this.timerId = setInterval(() => {
        // 业务逻辑
        // console.log('每50秒一次')
        this.updateLoginUserStatus()
      }, 50000)
    }
  },
  beforeDestroy() {
    if (this.timerId) { //注销定时器
      // console.log('注销定时器')
      clearInterval(this.timerId);
      this.timerId = null;
    }
  },
  methods: {
    //
    async updateLoginUserStatus() {
      if (getToken()) {
        let res = await this.$API.system.updateLoginUserStatus()
        // console.log(res, "updateLoginUserStatus")
      }

    },
  }
}
</script>
<style>
/* .el-dialog__wrapper{
    z-index: 999 !important;
  }
  .v-modal{
    z-index: 998 !important;
  } */
.ant-calendar-picker-container {
  z-index: 2050 !important;
}
</style>
